import { SafeAreaProvider } from "react-native-safe-area-context";
import { Provider as StoreProvider } from "react-redux";
import { Provider as PaperProvider, useTheme } from "react-native-paper";
import store from "@/store/index";
import GlobalProvider from "@/GlobalMethodProvider/Provider";
import Provider from "@/Provider";
import theme from "@/styles/theme";

function App(): JSX.Element {
  const PaperTheme = useTheme();

  return (
    <SafeAreaProvider>
      <StoreProvider store={store}>
        {/* 设置 ui的主题 */}
        <PaperProvider
          theme={{
            colors: {
              ...PaperTheme.colors,
              ...theme.compomentColor
            }
          }}
        >
          <GlobalProvider>
            <Provider />
          </GlobalProvider>
        </PaperProvider>
      </StoreProvider>
    </SafeAreaProvider>
  );
}

export default App;
